Sensor Fusion for Kinetis MCUs (ISSDK/KSDK version)
driver_pit.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void pit_init (uint32_t microseconds)
 

Variables

volatile bool pitIsrFlag
 

Detailed Description

Bare metal implementations of the sensor fusion library require at least one periodic interrupt for use as a timebase for sensor fusion functions. The Periodic Interval Timer (PIT) is one such module that is commonly found on NXP Kinetis MCUs. The PIT functions are only referenced at the main() level. There is no interaction within the fusion routines themselves.

Definition in file driver_pit.h.

Function Documentation

void pit_init ( uint32_t  microseconds)

Definition at line 62 of file driver_pit.c.

Referenced by main().

63 {
64  /* initialize PIT */
65  pit_config_t pitConfig; // Declare KSDK PIT configuration structure
66  PIT_GetDefaultConfig(&pitConfig); // Fill out that structure with defaults
67  PIT_Init(PIT, &pitConfig); // PIT is declared by the KSDK
68  // We choose to use Channel 0 of the PIT. That can obviously be changed
69  PIT_SetTimerPeriod(PIT, kPIT_Chnl_0, USEC_TO_COUNT(microseconds, PIT_SOURCE_CLOCK));
70  PIT_EnableInterrupts(PIT, kPIT_Chnl_0, kPIT_TimerInterruptEnable);
71  EnableIRQ(PIT_IRQ_ID);
72  PIT_StartTimer(PIT, kPIT_Chnl_0);
73 }
#define PIT_IRQ_ID
Definition: driver_pit.c:50
#define PIT_SOURCE_CLOCK
Definition: driver_pit.c:51

+ Here is the caller graph for this function:

Variable Documentation

volatile bool pitIsrFlag

Definition at line 53 of file driver_pit.c.

Referenced by main(), and PIT_LED_HANDLER().